package com.es.disped.dao.oj.mapper;

import com.es.disped.dao.oj.model.Balloon;
import com.es.disped.dao.oj.model.BalloonExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BalloonMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table balloon
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=BalloonSqlProvider.class, method="countByExample")
    long countByExample(BalloonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table balloon
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @DeleteProvider(type=BalloonSqlProvider.class, method="deleteByExample")
    int deleteByExample(BalloonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table balloon
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Delete({
        "delete from balloon",
        "where balloon_id = #{balloonId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer balloonId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table balloon
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Insert({
        "insert into balloon (balloon_id, user_id, ",
        "sid, cid, pid, ",
        "status)",
        "values (#{balloonId,jdbcType=INTEGER}, #{userId,jdbcType=CHAR}, ",
        "#{sid,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, ",
        "#{status,jdbcType=SMALLINT})"
    })
    int insert(Balloon record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table balloon
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @InsertProvider(type=BalloonSqlProvider.class, method="insertSelective")
    int insertSelective(Balloon record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table balloon
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=BalloonSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="balloon_id", property="balloonId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.CHAR),
        @Result(column="sid", property="sid", jdbcType=JdbcType.INTEGER),
        @Result(column="cid", property="cid", jdbcType=JdbcType.INTEGER),
        @Result(column="pid", property="pid", jdbcType=JdbcType.INTEGER),
        @Result(column="status", property="status", jdbcType=JdbcType.SMALLINT)
    })
    List<Balloon> selectByExample(BalloonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table balloon
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Select({
        "select",
        "balloon_id, user_id, sid, cid, pid, status",
        "from balloon",
        "where balloon_id = #{balloonId,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="balloon_id", property="balloonId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.CHAR),
        @Result(column="sid", property="sid", jdbcType=JdbcType.INTEGER),
        @Result(column="cid", property="cid", jdbcType=JdbcType.INTEGER),
        @Result(column="pid", property="pid", jdbcType=JdbcType.INTEGER),
        @Result(column="status", property="status", jdbcType=JdbcType.SMALLINT)
    })
    Balloon selectByPrimaryKey(Integer balloonId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table balloon
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=BalloonSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Balloon record, @Param("example") BalloonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table balloon
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=BalloonSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Balloon record, @Param("example") BalloonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table balloon
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=BalloonSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Balloon record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table balloon
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Update({
        "update balloon",
        "set user_id = #{userId,jdbcType=CHAR},",
          "sid = #{sid,jdbcType=INTEGER},",
          "cid = #{cid,jdbcType=INTEGER},",
          "pid = #{pid,jdbcType=INTEGER},",
          "status = #{status,jdbcType=SMALLINT}",
        "where balloon_id = #{balloonId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Balloon record);
}